var  image= [
    "../static/images/bg_1.jpg",
    "../static/images/bg_2.jpg",
    "../static/images/bg_3.jpg",
    "../static/images/bg_4.jpg"
];
var index=0
window.onload=autoChangeBackgroud()
var back_class=document.getElementById("login-bg")
var login=document.getElementsByClassName("login")
function autoChangeBackgroud() {
    setInterval(function () {
        this.changeImage()
        index++;
        if (index==image.length){
            index=0
        }
        console.log("展示的图片为"+index)
    },3000)
}
function  changeImage() {
    console.log("jquery切换的背景")
    //$(".login-bg").css({ opacity: 0.8 });  //设置透明度
    $.backstretch(["bg_1.jpg"]); //背景
    ///$(".login-bg").backstretch(["b.jpg","a.jpg","coffee.jpg"],{duration:4000});
    $(".login-bg").backstretch(image[index],{duration:3000});
}
